﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using Beeldbankmvc.Models;
using System.Web.Mvc;

namespace Beeldbankmvc.ViewModels
{
    public class ReactionViewModel
    {
        // paging
        public int pageSize;
        public int reactionPageIndex;
        public int numberOfRowsReaction;

        public List<BEELDBANK_REACTIE> reactionObjects { get; set; }
        public List<BEELDBANK_REACTIE_CORRESPONDENTIE> correspondenceObjects { get; set; }
        
        ReactionStatusRepository ReacionStatusRep = new ReactionStatusRepository();
        ReactionCorrespondenceRepository ReacionCorrespondence = new ReactionCorrespondenceRepository();
        
        public SelectList ReactionStatuses { get; private set; }

        public ReactionViewModel(BEELDBANK_REACTIE reaction)
        {
            var allStatus = ReacionStatusRep.FindAll();
            ReactionStatuses = new SelectList(allStatus, "Id", "Name", reaction.Status);

            // find all related correspondence items
            correspondenceObjects = ReacionCorrespondence.FindAllSortedByReactionId(reaction.Id).ToList();
        }

        public ReactionViewModel()
        {
            // Constructor for index
        }
 
    }
}
